/*
 * @Author: 李小晴 2689279066@qq.com
 * @Date: 2023-04-04 17:03:09
 * @LastEditors: 李小晴 2689279066@qq.com
 * @LastEditTime: 2023-04-06 10:56:55
 * @FilePath: \sys\src\api\fa\insurance\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()
import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 保险列表
export const zcInsuranceOrderListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcInsuranceOrderList',
      data: data
    }
  })
}
// 合同修改
export const zcInsuranceOrderContractEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcInsuranceOrderContractEdit',
      data: data
    }
  })
}
// 保险新增
export const zcInsuranceOrderAddAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcInsuranceOrderAddAdmin',
      data: data
    }
  })
}

// 保险查看
export const zcInsuranceOrderSeeApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcInsuranceOrderSee',
      data: data
    }
  })
}
// 保险明细
export const zcInsuranceOrderDetailedListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcInsuranceOrderDetailedList',
      data: data
    }
  })
}

// 保险编辑
export const zcInsuranceOrderEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcInsuranceOrderEdit',
      data: data
    }
  })
}

// 保险删除
export const zcInsuranceOrderDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcInsuranceOrderDel',
      data: data
    }
  })
}

// 平台保险审核
export const zcInsuranceOrderAdminExamineApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcInsuranceOrderAdminExamine',
      data: data
    }
  })
}

// 平台保险确认
export const zcInsuranceOrderConfirmApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcInsuranceOrderConfirm',
      data: data
    }
  })
}

// 附件列表
export const sysRelFileListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysRelFileList',
      data: data
    }
  })
}
// 附件批量新增
export const sysRelFileBatchAddApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysRelFileBatchAdd',
      data: data
    }
  })
}

// 附件批量删除
export const sysRelFileBatchDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysRelFileBatchDel',
      data: data
    }
  })
}

// excel文件
export const dbInsuranceOrderDetailedListApi = (data: any) => {
  return request.post({
    url: '/index.php/tools/excel/common',
    headers: { token: wsCache.get('token') },
    data: {
      api_code: 'dbInsuranceOrderDetailedList',
      request: data.request,
      layout_data: data.layout_data
    }
  })
}
